<script type="text/javascript">


function delid(id) {
    
    $("#del").attr("href", "delcat/"+id);
    return true;
};

</script>
<div class="row-fluid marketing">
    <div class="span12">
        <table class="table">
            <thead>
                <tr>
                    <th>id</th><th>link</th><th>name</th><th>edit</th>

                </tr>
            </thead>

            <?php foreach ($cats as $row): ?>

                <tr>
                    <td><?= $row['id'] ?></td><td><?= $row['link'] ?></td><td><?= $row['name'] ?></td><td> <?php echo anchor('admin/admin/catedit/' . $row['id'], 'edit') . '/<a href="/delete" data-target="#myModal" data-toggle="modal" onclick="delid('.$row['id'].')">del</a>'; ?></td>
                </tr>


            <?php endforeach; ?>

            <tr><td><?php echo anchor('admin/admin/catinsert', 'insert cat'); ?></td><td></td><td></td><td></td></tr>
        </table>
    </div>
</div>

<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Modal header</h3>
    </div>
    <div class="modal-body">
        <p>Действительно удалить?</p>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">Нет</a>
        <a href="#" class="btn btn-primary" id="del">Удалить</a>
    </div>
</div>